package com.lill.common.component.util;

import java.util.Date;

/**
 * 订单号生成
 */
public class OrderNumberUtil {

    public static String getOrderNumberYYYYMMDDHHMMSS(){
        StringBuffer oddNum = new StringBuffer();
        oddNum.append(DateUtils.format(new Date(),"yyMMddHHmmss"));
        for(int i=0;i<3;i++){
            oddNum.append(Math.round(Math.random()*10));
        }
        return oddNum.toString();
    }
    public static String getOrderNumberYYYYMMDDHHMMSSByDate(Date date){
        StringBuffer oddNum = new StringBuffer();
        oddNum.append(DateUtils.format(date,"yyMMddHHmmss"));
        for(int i=0;i<3;i++){
            oddNum.append(Math.round(Math.random()*10));
        }
        return oddNum.toString();
    }
    public static String getOrderNumberYYYYMMDDHH(){
        StringBuffer oddNum = new StringBuffer();
        oddNum.append(DateUtils.format(new Date(),"yyMMddHHmm"));
        for(int i=0;i<1;i++){
            oddNum.append(Math.round(Math.random()*10));
        }
        return oddNum.toString();
    }
}
